<!--
 * @Author: your name
 * @Date: 2021-11-04 19:13:52
 * @LastEditTime: 2021-11-04 21:26:16
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ej-app2\src\components\Swipper.vue
-->
<template>
    <van-swipe class="my-swipe" :autoplay="2000" indicator-color="white">
        <van-swipe-item v-for="item in imgList" :key=item.id>
            <van-image width="365" height="160" :src="item.url" />
        </van-swipe-item>
    </van-swipe>
</template>

<script>
import {get} from "../utils/axios"
export default {
    data(){
        return{
            imgList:{}//保存轮播图数据
        }
    },
    methods:{
        getSwipperData(){
            get('/carousel/findAll').then((res)=>{
                // console.log(res.data)
                this.imgList=res.data;
            })
        }
    },
    created(){
        this.getSwipperData()
    }
}
</script>

<style scoped>

van-swipe-item{
    border-radius: 20px;
}
</style>